package com.hangxin.system.sql;

public class SyslogSql
{
	// 操作日志保存
	public final static String SAVELOG = "insert into syslog(loginid,loginname,companyname,logtype,modular,content,addtime,userid) values(?,?,?,?,?,?,?,?)";

	// 日志查询
	public final static String LOGPAGE = "select t.* from syslog t,LOGININFO lg WHERE t.userid=LG.ID  and 1=1 :dynamic limit ?,?";

	// 条数
	public final static String LOGCOUNT = "select count(*) from syslog t where 1=1 :dynamic";

	// 根据登录id分页查询
	public final static String LOGPAGEBYLOGINID = "SELECT * FROM (SELECT A.*, ROWNUM RN FROM (select t.*,s.NAME from syslog t,SYS_EMPLOYEE s,LOGININFO lg WHERE t.userid=LG.ID and LG.EMPLOYEEID=s.EMPLOYEE_ID and t.modular=? AND t.LOGINID=? :dynamic) A WHERE ROWNUM <= ?)WHERE RN > ?";

	// 根据登录id查询条数
	public final static String LOGCOUNTBYLOGINID = "select count(*) from(select t.*,s.NAME from syslog t,SYS_EMPLOYEE s,LOGININFO lg WHERE t.userid=LG.ID and LG.EMPLOYEEID=s.EMPLOYEE_ID and t.modular=? AND t.LOGINID=? :dynamic)";
}
